package com.admin.common.enums.sample;

/**
 * 抽样类型枚举
 *
 */
public enum SampleTypeEnum {
    PROVINCE_SAMPLE(2, "省抽样"),
    CITY_SAMPLE(1, "市抽样"),
    AREA_SAMPLE(0, "区县抽样")
    ;

    private Integer type;
    private String desc;

    SampleTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

    public static SampleTypeEnum getEnum(Integer type) {
        if (type == null) {
            return null;
        }
        for (SampleTypeEnum e : SampleTypeEnum.values()) {
            if (e.getType().equals(type)) {
                return e;
            }
        }
        return null;
    }
}
